package com.csii.epaySandbox.controller;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.csii.epaySandbox.dao.DeptDao;
import com.csii.epaySandbox.exception.BankException;
import com.csii.epaySandbox.service.BankService;
import com.csii.epaySandbox.util.JsonResult;

@Controller
public class BankController extends AbstractController {
	
	@Resource
	private BankService bankService;
	
	@RequestMapping("/selectBank.do")
	@ResponseBody
	public JsonResult excute(String departmentId){
		List bankList = bankService.getBankList(departmentId);
		return new JsonResult(bankList);
	}
	
	@ExceptionHandler(BankException.class)
	@ResponseBody
	public JsonResult handlerBankException(BankException e){
		return new JsonResult(2,e);
	}
	
}
